<#assign ctx=springMacroRequestContext.contextPath />
<#include "/macro/publicMacro.ftl">
<#import "/macro/pagination.ftl" as Pagination>
<#import "/macro/FormItem.ftl" as Form>

<@header title="ImGroup编辑">
    <link href="${ctx}/resource/frame/datetimepicker/jquery.datetimepicker.min.css" rel="stylesheet">
</@header>

<@body>
<h2 class="module-title">ImGroup编辑</h2>

<div class="alert alert-primary" role="alert">
    <button class="btn btn-info" onclick="javascript: history.back(-1);return false;" >返回</button>
</div>

<form class="form-horizontal" id="imGroupForm" action="${ctx}/imGroup/save" method="post">
    <input type="hidden" name="id" value="${imGroup.id}"/>
    <@Form.FormItem name="name" label="群名称">
        <input type="text" class="form-control" name="name" id="name" aria-describedby="群名称" value="${imGroup.name}">
    </@Form.FormItem>
    <@Form.FormItem name="ownerId" label="群主">
        <input type="text" class="form-control" name="ownerId" id="ownerId" aria-describedby="群主" value="${imGroup.ownerId}">
    </@Form.FormItem>
    <@Form.FormItem name="enable" label="是否可用">
        <input type="text" class="form-control" name="enable" id="enable" aria-describedby="是否可用" value="${imGroup.enable}">
    </@Form.FormItem>
    <@Form.FormItem name="tenantId" label="租户id">
        <input type="text" class="form-control" name="tenantId" id="tenantId" aria-describedby="租户id" value="${imGroup.tenantId}">
    </@Form.FormItem>
    <@Form.FormItem name="createTime" label="创建时间">
        <div class='input-group date' id='createTime1'>
            <input type="text" class="form-control" name="createTime" id="createTime" aria-describedby="创建时间" value="${(imGroup.createTime?string('yyyy-MM-dd hh:mm:ss'))!}">
            <span class="input-group-addon">
                <span class="glyphicon glyphicon-calendar"></span>
            </span>
        </div>
    </@Form.FormItem>
    <@Form.FormItem name="updateTime" label="更新时间">
        <div class='input-group date' id='updateTime1'>
            <input type="text" class="form-control" name="updateTime" id="updateTime" aria-describedby="更新时间" value="${(imGroup.updateTime?string('yyyy-MM-dd hh:mm:ss'))!}">
            <span class="input-group-addon">
                <span class="glyphicon glyphicon-calendar"></span>
            </span>
        </div>
    </@Form.FormItem>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-primary">提交</button>
        </div>
    </div>
</form>
</@body>

<@footer>
    <script src="${ctx}/resource/frame/datetimepicker/jquery.datetimepicker.full.min.js"></script>
    <script src="${ctx}/resource/common/js/jquery.validate.min.js"></script>

    <script type="text/javascript">
        $(function () {
            $('#createTime').datetimepicker({
                format:'Y-m-d H:i:s',
                lang:'zh'});
            $('#updateTime').datetimepicker({
                format:'Y-m-d H:i:s',
                lang:'zh'});
        });

        $().ready(function() {
            $("#imGroupForm").validate({
                rules: {
                    id: {
                        required: true,
                        digits: true
                    },
                    name: "required" ,
                    ownerId: {
                        required: true,
                        digits: true
                    },
                    enable: {
                        required: true,
                        digits: true
                    },
                    tenantId: {
                        required: true,
                        digits: true
                    },
                    createTime: {
                        required: true,
                        date: true
                    },
                    updateTime: {
                        required: true,
                        date: true
                    }
                }
            });
        });
    </script>
</@footer>